package AdapterPattern;

public class Test {
    public static void main(String[] args) {
        Cat cat = new ConcreteCat();
        Dog dog = new ConcreteDog();
        Adapter adapter = new Adapter();
        adapter.setDog(dog);
        adapter.setCat(cat);
        cat = (Cat)adapter;
        cat.catCry(); //猫学狗叫
        dog = (Dog)adapter;
        dog.action(); //狗学猫抓老鼠
    }
}
